package com.mh.www.mh_frame.presenter.present.impl;

import com.mh.www.mh_frame.model.bean.MeetingSummaryBean;
import com.mh.www.mh_frame.model.bean.StandardBean;
import com.mh.www.mh_frame.network.RetrofitFactory;
import com.mh.www.mh_frame.presenter.iview.StandardView;
import com.mh.www.mh_frame.presenter.present.StandardPresent;
import com.mh.www.mh_frame.presenter.present.base.BasePresenterImpl;
import com.orhanobut.logger.Logger;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

public class StandardPresentImpl extends BasePresenterImpl<StandardView> implements StandardPresent{
    @Override
    public void getStandList(String titles, String pagenum, String types, String pipeLineId) {
        RetrofitFactory.getInstence().API()
                .getStand(titles,pagenum,types,pipeLineId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Observer<StandardBean>() {
                    @Override
                    public void onSubscribe(Disposable d) {

                    }

                    @Override
                    public void onNext(StandardBean standardBean) {
                        Logger.e("onNext"+"---"+standardBean);
                        mView.setData(standardBean);
                    }

                    @Override
                    public void onError(Throwable e) {
                        Logger.e("onError"+e.getMessage()+"--");
                    }
                    @Override
                    public void onComplete() {
                        Logger.e("完成","onCompleted");
                    }
                });
    }
}
